home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 2.iso
/
bin
/
LinkCdResource
< prev
next >
Wrap
Text File
|
1996-11-11
|
866b
|
35 lines
#!/bin/perl
$ENV{'PATH'} = "/usr/bsd:/bin/:/usr/bin:/usr/sbin:/usr/bin/X11";
# read $HOME/.dtresource file and link SGI CDs to virtual document root
$htdocs = "$ARGV[0]";
$dtWWWroot = "$ARGV[1]";
$this_CD = "$ARGV[2]";
open(IN, "$dtWWWroot/.dtcdresource") ||
die "Unable to read $dtWWWroot/.dtcdresource in LinkCdResource\n";
$_ = <IN>; # burn first line
while (<IN>) {
chop;
s/\s.*// || die "$dtWWWroot/.dtcdresource is misformatted\n";
$path = $_;
if (open(IM, "$path/.IM")) {
$cdnum = -1;
while (<IM>) {
next unless /^id\s*=\s*"(\d+)"\s*$/;
$cdnum = $1;
last;
}
} elsif (open(IM, "$path/IM")) {
$cdnum = <IM>;
chop $cdnum;
} else {
next;
}
close(IM);
die "Unable to find id number in $path/.IM\n" if $cdnum < 0;
`/usr/bin/ln -s $path $htdocs/ext_cd$cdnum > /dev/null 2>&1`;
print "CDROM drive: $path\n";
}